Learn R Programming

OutbreakTools (version 0.1-16)

Plot obkData: Plot outbreak data

Description

The plot method of '>obkData objects includes various options:

  • timeline: plots requested information as time series; uses plotIndividualTimeline.

  • geo: plots requested information as geographic distribution, on a map; uses plotGeo.

  • mst: minimum-spanning tree based on genetic distances; uses plotggMST.

  • phylo: plot phylogenetic trees stored in the object; uses plotggphy.

  • contacts: plot contacts between individuals stored in the object; uses plot.obkContacts.

Usage

# S4 method for obkData
plot(x, y=c("timeline","geo","mst","phylo","contacts"), …)

Arguments

x

a '>obkData object

y

a character indicating the type of plot to be generated; can be "timeline" (default), "geo", "mst", "phylo", or "contacts".

further arguments to be passed to the plotting function, depending on the type of plot selected (see description above).

See Also

plotIndividualTimeline, plotGeo, plotggMST, plotggphy, plot.obkContacts.

Examples

Run this code
# NOT RUN {
data(HorseFlu)
head(HorseFlu)

## default plot: time line
plot(HorseFlu,orderBy='yardID',colorBy='yardID')
plot(HorseFlu,orderBy='yardID',colorBy='yardID',
     selection=1:30) # only the first 30

## plot contacts
data(ToyOutbreak)
plot(ToyOutbreak, "contacts")

# }
# NOT RUN {
## plot geographic distribution of individuals
plot(HorseFlu, "geo", location=c('lon','lat'), colorBy='sex',
     zoom=12,center='9')

## plot minimum spanning tree for first 10 individuals
get.nindividuals(HorseFlu)
plot(subset(HorseFlu, individuals=1:10), "mst")
# }

Run the code above in your browser using DataLab